Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omnibar position option #4885

Merged
merged 56 commits into from
Sep 25, 2024
Merged

Omnibar position option #4885

merged 56 commits into from
Sep 25, 2024

Conversation

0nko
Copy link
Member

@0nko 0nko commented Aug 9, 2024

Task/Issue URL: https://app.asana.com/0/1207418217763355/1208356719296150/f

Description

This is a feature branch for the omnibar position project.

Testing instructions

Dummy toolbar

  • Start the omnibar at the top
  • Use the Fire button and notice the dummy toolbar is briefly shown at the top
  • Change the omnibar to the bottom
  • Use the Fire button and notice the dummy toolbar is briefly shown at the bottom

Autocomplete

  • Change the omnibar position to the bottom
  • Start typing in the address bar
  • Notice the suggestions are correctly displayed above the toolbar

UI changes

Before After
image image

Snackbar

  • Change the omnibar position to the bottom
  • Trigger a condition to show a snackbar (see the diff below)
  • Notice the snackbar is displayed above the omnibar

This patch will triggers a snackbar after tapping the fire button:

Index: app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt b/app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt
--- a/app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt	(revision Staged)
+++ b/app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt	(date 1725012737445)
@@ -3299,6 +3299,7 @@
     }
 
     fun onFireMenuSelected() {
+        showErrorWithAction()
         val cta = currentCtaViewState().cta
         if (cta is OnboardingDaxDialogCta.DaxFireButtonCta) {
             onUserDismissedCta(cta)

UI changes

Before After
image image

Privacy pop-up dialog

  • Go to settings and change the omnibar position to BOTTOM
  • Go back to the tab
  • Trigger the privacy popup condition by refreshing the page
  • Notice the dialog correctly appears at the bottom

UI changes

Before After
image image

Onboarding messages

  • Clear the app storage and trigger onboarding
  • Change the omnibar position to the bottom
  • Go to “google.com"
  • Notice that during onboarding steps, whenever there is the “hand” icon, it points to the bottom

UI changes

Before After
image image

Feature flag tests

Bottom bar enabled

Use https://www.jsonblob.com/api/1287776240176848896 privacy config URL and the playRelease build, so that the feature flag is enabled

  • Go to Settings -> Appearance
  • Verify that there is the Address bar option to change the omnibar position

Bottom bar disabled

Use http://www.jsonblob.com/api/1287777925473361920 privacy config URL, so that the feature flag is enabled

  • Go to Settings -> Appearance
  • Verify that the Address bar option is not visible

Copy link
Member Author

0nko commented Aug 9, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @0nko and the rest of your teammates on Graphite Graphite

@0nko 0nko mentioned this pull request Aug 9, 2024
9 tasks
@0nko 0nko force-pushed the feature/ondrej/omnibar-position branch 2 times, most recently from 99ecf5e to adaf626 Compare August 21, 2024 21:49
@0nko 0nko force-pushed the feature/ondrej/omnibar-position branch from adaf626 to e6f425a Compare August 23, 2024 10:21
@0nko 0nko requested a review from malmstein August 23, 2024 10:37
@0nko 0nko force-pushed the feature/ondrej/omnibar-position branch from efd808b to dcd1d5e Compare August 28, 2024 10:44
@0nko 0nko force-pushed the feature/ondrej/omnibar-position branch from ed0ac91 to b906747 Compare August 29, 2024 15:12
@0nko 0nko mentioned this pull request Aug 30, 2024
4 tasks
@0nko 0nko force-pushed the feature/ondrej/omnibar-position branch 2 times, most recently from 1ab54e1 to 2b7eaca Compare September 2, 2024 12:37
@0nko 0nko mentioned this pull request Sep 2, 2024
11 tasks
@0nko 0nko marked this pull request as ready for review September 9, 2024 16:00
@0nko 0nko force-pushed the feature/ondrej/omnibar-position branch from 40ecd9e to b0dd837 Compare September 9, 2024 16:55
Copy link
Contributor

@malmstein malmstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a couple of outstanding comments from previous PR.
The big issue is that when the omnibar is at the bottom we are over the web content, and not properly pushing it to the top. That makes it so any content at the bottom of the viewport is behind the omnibar.

* limitations under the License.
*/

package com.duckduckgo.app.browser.omnibar.model
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this in the browser-api module?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on what I observed, it seemed like the right place to put a common model that might be accessed by different modules in the future. If you feel it’s not the right place I’m open to suggestions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If another module would need to access the omnibar position, they will do it via the SettingsDataStore. You have placed the model in the browser-api module, but the public accessor to that value is in the app module.

This module is specifically for things related to the browser. The omnibar and it’s position are separate from that. In other words, omnibar doesn’t need to know anything about the browser. I’d move it to the same app/omnibar package you have the rest of the logic.

@0nko 0nko force-pushed the feature/ondrej/omnibar-position branch from 7bd0bd1 to cd4a537 Compare September 12, 2024 09:46
@0nko
Copy link
Member Author

0nko commented Sep 12, 2024

The big issue is that when the omnibar is at the bottom we are over the web content, and not properly pushing it to the top. That makes it so any content at the bottom of the viewport is behind the omnibar.

@malmstein Thanks for the review. I will fix this in a separate PR. The rest of the comments should be addressed now.

I added steps for testing different scenarios in the PR description.

@0nko 0nko requested a review from malmstein September 12, 2024 10:26
@0nko 0nko mentioned this pull request Sep 12, 2024
@0nko 0nko force-pushed the feature/ondrej/omnibar-position branch from 1672676 to 37114ff Compare September 17, 2024 14:33
Copy link
Contributor

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @0nko and the rest of your teammates on Graphite Graphite

@0nko 0nko force-pushed the feature/ondrej/omnibar-position branch from 37114ff to 3864a65 Compare September 19, 2024 09:00
@0nko
Copy link
Member Author

0nko commented Sep 23, 2024

@malmstein I’ve updated the test instructions to include tests of the feature flag, as well.

Copy link
Contributor

@malmstein malmstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good and works as expected. Thanks @0nko !

@0nko 0nko enabled auto-merge (squash) September 25, 2024 09:21
@0nko 0nko merged commit 51036fd into develop Sep 25, 2024
6 checks passed
@0nko 0nko deleted the feature/ondrej/omnibar-position branch September 25, 2024 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants